package com.yxkj.railservicer.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.yxkj.railservicer.util.HeartBreakUtil;
import okhttp3.OkHttpClient;

/**
 *  接收定时消息，向服务器发送心跳
 * Created by xuyu on 2017/3/21.
 */

public class HeartBreakMsgReceiver extends BroadcastReceiver {

    private static OkHttpClient client;

    @Override
    public void onReceive(Context context, Intent intent) {
        if( client == null){
            client = new OkHttpClient();
        }
        HeartBreakUtil.sendHeartBreakPacket(client,context,null);
    }
}
